import request from '@/utils/request'

// 注册接口
export const registe = (data) => {
  return request({ url: '/user/registered', method: 'post', data })
}
// 登录接口
export const login = (data) => {
  return request({ url: '/user/login', method: 'post', data })
}
//轮播图接口
export const swiper = () => {
  return request({ url: '/home/swiper', method: 'get' })
}
// home页栅格列表
export const listcontent = (data) => {
  return request({ url: `/home/groups?${data}`, method: 'get' })
}
// 全部城市接口
export const citylistName = () => {
  return request({ url: '/area/city?level=1' })
}
// 热门城市接口
export const hotcity = () => {
  return request({ url: '/area/hot' })
}
// 获取用户信息
export const user = () => {
  return request('/user')
}
// 发送已发布房源列表
export const houses = (params) => {
  return request('/user/houses', { params })
}
// 发送已发布房源列表
export const favorites = (params) => {
  return request('/user/favorites', { params })
}
// 获取租房列表
export const housesList = (params) => {
  return request('/houses', { params })
}
// 获取查询条件
export const condition = (params) => {
  return request('/houses/condition', { params })
}
// 地图房屋信息
export const areamap = (id) => {
  return request('/area/map', { params: { id } })
}
// 小区关键字搜索
export const communityHousers = (params) => {
  return request('/area/community', { params })
}
// 发布房源
export const rentadd = (data) => {
  return request.post('/user/houses', data)
}
// 转换图片
export const image = (data) => {
  return request({ 
    url: '/houses/image', 
    method:'post',
    headers: {'Content-Type': 'multipart/form-data'},
    data 
  })
}
